Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

delimiter-regex

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

delimiter-regex

Create regex for template delimiters.

  • 1.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
52K
decreased by-17.96%
Maintainers
1
Weekly downloads
 
Created
Source

delimiter-regex NPM version Build Status

Create regex for template delimiters.

Install with npm

npm i delimiter-regex --save

Usage

var delims = require('delimiter-regex');

Example:

Get a regex for matching front-matter:

delims('---', '---');
//=> /---\s*([\s\S]*?)\s*---/

If no args are passed, es6 delimiter regex is returned:

delims();
//=> /\$\{\s*([\s\S]*?)\s*\}/

Params

  • delimiters {String|Array}: supports array format (delims(['{{', '}}'])) or list (delims('{{', '}}'))
  • options: currently RegExp flags is the only option

Flags example

delims('{{', '}}', {flags: 'gm'});
//=> /\{\{([^}}]*)\}\}/gm

Running tests

Install dev dependencies.

npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright (c) 2014-2015 Jon Schlinkert
Released under the MIT license


This file was generated by verb-cli on March 18, 2015.

Keywords

FAQs

Package last updated on 18 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc